package newsDemo.pojo;

import lombok.Data;

@Data
public class Result<T> {
    private int status;
    private T data;
    private String message;

    public Result(int status, T data, String message) {
        this.status = status;
        this.data = data;
        this.message = message;
    }

    public static <T> Result<T> success(T data) {
        return new Result(200, data, null);
    }
    public static <T> Result<T> success() {
        return new Result(200, null, null);
    }
    public static <T> Result<T> fail(int data, String message) {
        return new Result(data, null, message);
    }
}
